package main

import (
	"gicechina/help"
	"net/http"
	"gicechina/controller"
)

func main() {
	help.P("程序版本号:" + help.GetVersion() + ",运行地址" + help.WebConfig.Address)
	mux := http.NewServeMux()
	server := http.Server{
		Addr:    help.WebConfig.Address,
		Handler: mux,
	}
	//设置静态文件路径
	files := http.FileServer(http.Dir(help.WebConfig.Static))
	mux.Handle("/static/",http.StripPrefix("/static/",files))
	mux.HandleFunc("/",(&controller.IndexController{}).Index)
	mux.HandleFunc("/about",(&controller.Category{}).About)
	mux.HandleFunc("/advantage",(&controller.Category{}).Advantage)
	mux.HandleFunc("/culture",(&controller.Category{}).Culture)
	mux.HandleFunc("/active",(&controller.Category{}).Active)
	mux.HandleFunc("/project",(&controller.Category{}).Project)
	mux.HandleFunc("/news",(&controller.Category{}).News)
	mux.HandleFunc("/contact",(&controller.Category{}).Contact)
	mux.HandleFunc("/video",(&controller.Category{}).Video)
	mux.HandleFunc("/job",(&controller.Category{}).Job)
	mux.HandleFunc("/newsDetail",(&controller.Detail{}).NewsDetail)
	mux.HandleFunc("/jobDetail",(&controller.Detail{}).JobDetail)
	mux.HandleFunc("/activeDetail",(&controller.Detail{}).ActiveDetail)
	mux.HandleFunc("/projectDetail",(&controller.Detail{}).ProjectDetail)
	mux.HandleFunc("/onlineCourse",(&controller.Category{}).OnlineCourse)
	server.ListenAndServe()
}
